import axios from "@/server"

// 任务状态列表
interface TasksList {
    // 任务类型
    taskStatus: string;
    // 页码 页数
    pageNo?: number;
    pageSize?: number;
}

// 任务状态列表
export function tasksList(params: TasksList) {
    return axios({
        url: `/v1/tasks/list`,
        method: "get",
        params,
    });
}

// 任务状态
export function tasksStatus() {
    return axios({
        url: `/v1/tasks/status`,
        method: "get",
    });
}

// 任务重试
export function taskRetry(taskId: string) {
    return axios({
        url: `/v1/tasks/retry`,
        method: "post",
        params: {
            taskId: taskId
        }
    });
}

// 任务删除
export function taskDelete(taskId: string) {
    return axios({
        url: `/v1/tasks/delete`,
        method: "delete",
        params: {
            taskId: taskId
        }
    });
}